package org.example.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.example.entity.Tester;
import org.example.entity.TesterVo;
import org.example.mapper.TesterMapper;
import org.example.service.ITesterService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TesterServiceImpl extends ServiceImpl<TesterMapper, Tester> implements ITesterService {

    @Override
    public TesterVo getTesterVoById(Integer id) {
        return this.baseMapper.getTesterVoById(id);
    }

    @Override
    public PageInfo<TesterVo> getTestVoListByPage(Integer page, Integer limit,String searchTesterName) {
        PageHelper.startPage(page,limit);
        List<TesterVo> testVoList = this.getBaseMapper().getTestVoList(searchTesterName);
        PageInfo<TesterVo> pageInfo = new PageInfo<>(testVoList);
        return pageInfo;
    }
}
